package com.john.booter.schedule;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.john.booter.module.file.service.FileService;

@Component
@Configurable
@EnableScheduling
public class TaskScheduler {
	protected Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private FileService fileService;
	/**
	 * 清理临时文件<br/>
	 * <code>每天04:15.am触发</code>
	 */
	@Scheduled(cron="0 15 04 ? * *")
	public void clearTempFiles() {
		logger.debug("临时文件清理任务开始执行>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
		fileService.clearTempFiles();
		logger.debug("临时文件清理任务执行完毕<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");

	}
	
}
